﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using OVS.CoreDomain;
using OVS.CoreDomain.Business;
using OVS.CoreDomain.Data;
using OVS.Data;


namespace OVS.Business
{
    public class BusinessLogin : IBusinessLogin
    {
        private IDalLogin _dalLogin;
        private IBusinessPassword _businessPassword;
        


           public BusinessLogin(IDalLogin dalLogin, IBusinessPassword businessPassword)
        {
            _dalLogin = dalLogin;
            _businessPassword = businessPassword;
        }

           public BusinessLogin()
        {
            _dalLogin = new DalLogin();
            _businessPassword = new BusinessPassword();
        }
        public ILoggedin Login(string voterId, string password, bool isAdmin)
        {
            password = _businessPassword.EncryptPassword(password);
            return _dalLogin.Login(voterId, password, isAdmin);
        }

    }
}
